import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Calendar;

import client.entities.ClientVO;
import client.exceptions.BadClientException;
import client.exceptions.IncompleteClientException;
import client.exceptions.MissingClientException;
import dbExceptions.DataBaseErrorException;
import dbExceptions.NotSaleException;
import business.BusinessFacade;
import business.article.interfaces.ArticleMgt;
import business.article.managers.ArticleMgr;
import business.client.interfaces.ClientMgt;
import business.sale.entities.ArticleBill;
import business.sale.entities.Order;
import business.sale.entities.Sale;
import business.sale.interfaces.SaleMgt;
import business.sale.managers.SaleMgr;
import persistence.article.articleDAO.ArticleDAO;
import persistence.factura.facturaDAO.DataBaseException;
import persistence.factura.facturaDAO.FacturaDAO;
import persistence.sale.saleDAO.SaleDAO;
import sale.entities.OrderVO;
import sale.exceptions.EmptyOrderException;
import sale.exceptions.NoSalesException;
import article.entities.ArticleVO;
import article.entities.ComboVO;
import article.entities.IngredientVO;
import article.exceptions.IncompleteArticleException;
import article.exceptions.NotHereException;
import article.exceptions.OutOfStockIngredientsException;

public class TestMainNacho {

	public static void main(String[] args) throws RemoteException,
			NotHereException, IncompleteArticleException, EmptyOrderException,
			NotSaleException, DataBaseException,
			OutOfStockIngredientsException, NoSalesException,
			IncompleteClientException, MissingClientException,
			DataBaseErrorException, BadClientException {

		ArticleMgt aux = (ArticleMgt) BusinessFacade.getInstance()
				.getArticleMgt();
		SaleMgt auxS = BusinessFacade.getInstance().getSaleMgt();
		ClientMgt auxC = BusinessFacade.getInstance().getClientMgt();

		ArticleVO[] arts = aux.getArticles();
		ComboVO[] combs = aux.getComos();
		ArticleVO in = null;
		ArticleVO in2 = null;
		ComboVO in3 = combs[0];
		for (ArticleVO o : arts) {
			if (o.getPrimaryKey() == 1000)
				in = o;
			if (o.getPrimaryKey() == 4000)
				in2 = o;
		}
		ArrayList<ArticleVO> temp = new ArrayList<ArticleVO>();
		temp.add(in);
		temp.add(in2);
		temp.add(in3);
		temp.add(in);
		ArrayList<String> temp1 = new ArrayList<String>();
		temp1.add(null);
		temp1.add(null);
		temp1.add(null);
		temp1.add(null);
		// auxS.newSale(new OrderVO(temp,temp1), 55, 0);

		aux.addInStock(aux.getAllIngredients()[0]);
		auxS.getOpenOrders();

		//auxC.addClient(new ClientVO("Clarice", "Leaman", "Potosi", "260", "099",
				//Calendar.getInstance().getTime(), "hola"));
		System.out.println("hello");

	}
}